Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor registry to return an error instead of panicking on duplicate registration #2151

Merged
merged 1 commit into from
Feb 25, 2025

Conversation

CascadingRadium
Copy link
Member

@CascadingRadium CascadingRadium commented Feb 25, 2025

  • The registry package currently panics or crashes Bleve when a duplicate component is registered. This behavior makes it difficult to handle duplicate registrations gracefully and requires using a recover statement to prevent the application from crashing.
  • To improve error handling and maintainability, the newly refactored proposed API will involve changing Register<registry-component> to return an error instead of panicking when a duplicate registration is detected. This change would allow developers to check if a <registry-component> is already registered and handle it accordingly without relying on recover.
  • Addresses registry.RegisterTokenFilter should Return Error Instead of Panicking on Duplicate Registration #2125

…on duplicate analysis component registration
@CascadingRadium CascadingRadium changed the title Refactor registry components to return an error instead of panicking on duplicate component registration Refactor registry to return an error instead of panicking on duplicate registration Feb 25, 2025
Copy link
Member

@abhinavdangeti abhinavdangeti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @CascadingRadium

@abhinavdangeti abhinavdangeti added this to the v2.5.0 milestone Feb 25, 2025
@CascadingRadium CascadingRadium merged commit 3333ab0 into master Feb 25, 2025
9 checks passed
@CascadingRadium CascadingRadium deleted the panicFix branch February 25, 2025 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants